<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2016/12/15
  Time: 15:26
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title></title>
    <link rel="stylesheet" type="text/css" href="easyui-1.3.6/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="easyui-1.3.6/themes/icon.css">
    <link rel="stylesheet" type="text/css" href="easyui-1.3.6/demo/demo.css">
    <script type="text/javascript" src="easyui-1.3.6/jquery.min.js"></script>
    <script type="text/javascript" src="easyui-1.3.6/jquery.easyui.min.js"></script>
</head>
<body>
<div class="row">
    <div class="col-md-12">
        <!-- BEGIN PAGE TITLE & BREADCRUMB-->
        <h3 class="page-title" id="index-page-title" style="font: normal 30px/0.8em '微软雅黑'">孜点教科</h3>
        <ul class="page-breadcrumb breadcrumb">
            <%--<li>
                <i class="fa fa-home"></i>
                首页
                <i class="fa fa-angle-right"></i>
            </li>--%>
            <li>
                <%--<a href="javascript:;">--%>
                抽奖管理
                <%--</a>--%>
                <i class="fa fa-angle-right"></i>
            </li>
            <li>
                <%--<a href="javascript:;">--%>
                设置抽奖
                <%--</a>--%>
            </li>
        </ul>
        <!-- END PAGE TITLE & BREADCRUMB-->
    </div>
</div>
<div style="margin:20px 0;"></div>
<div style="width:500px; margin:auto">
    <div class="easyui-panel" title="请按规定设置抽奖信息" style="width:500px;margin:0px auto;">
        <div style="padding:10px 60px 20px 60px">
            <form id="ff" class="easyui-form" method="post" data-options="novalidate:true"
                  enctype="multipart/form-data">
                <table style="margin-top:20px; ">
                    <tr>
                        <td style="display:inline-block;height:30px;line-height:30px;width:80px;">抽奖兑换地点:</td>
                        <td><input class="easyui-validatebox textbox" name="changeAddress"
                                   data-options="required:true,missingMessage:'不能为空！',validType:'length[1,20]',invalidMessage:'长度请为1到20之间！'"
                                   style="width:300px;height:30px; border:1px solid #d6dde5;background-color:transparent;padding:0px 10px;margin-bottom: 10px;">
                        </td>
                    </tr>
                    <tr>
                        <td style="display:inline-block;height:30px;line-height:30px;width:80px;">抽奖截至时间:</td>
                        <td><input class="easyui-datetimebox" name="changePrizeEndTime"
                                   data-options="required:true,missingMessage:'不能为空！'"
                                   style="width:180px;height:30px; border:1px solid #d6dde5;background-color:transparent;padding:0px 10px;margin-bottom:10px;">
                        </td>
                    </tr>
                </table>
                <input type="hidden" value="${user.teacherid}" name="manageId">
            </form>
            <div style="text-align:center;padding:5px">
                <a href="javascript:void(0)" class="easyui-linkbutton" onclick="submitForm()"
                   style="width:107px;height:30px;">提交</a>
                <a href="javascript:void(0)" class="easyui-linkbutton" onclick="clearForm()"
                   style="width:107px;height:30px;">清除</a>
            </div>
        </div>
    </div>
</div>
</body>
<script>
    function submitForm() {
        $('#ff').form('submit', {
            url: 'rest/page/manageIntegral/add',
            onSubmit: function () {
                return $(this).form('enableValidation').form('validate');
            },
            success: function (data) {
                var obj = JSON.parse(data)
                if (obj.code == 200) {
                    $.messager.show({
                        title: '操作提示', msg: obj.message, showType: 'show', style: {
                            top: ($(window).height() - 200) * 0.5,
                            left: ($(window).width() - 250) * 0.5
                        }
                    });
                } else {
                    $.messager.show({
                        title: '操作提示', msg: obj.message, showType: 'show', style: {
                            top: ($(window).height() - 200) * 0.5,
                            left: ($(window).width() - 250) * 0.5
                        }
                    });
                }
                $('#ff').form('clear');
            }
        });
    }
    function clearForm() {
        $('#ff').form('clear');
    }

</script>
</html>
